Preemptively disable unsigned integer sanitization in 32 and 64 bit versions of __murmur2_or_cityhash. This lets people use the unsigned integer overflow checker in UBSAN w/o getting hits from libc++'s hash code (where the unsigned integer overflow is legal and deliberate)> Patch by @danielaustin. Reviewed as: http://reviews.llvm.org/D15973 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@257368 91177308-0d34-0410-b5e6-96231b3b80d8 
diff --git a/include/__config b/include/__config index c0b1ef2..b6f7bd3 100644 --- a/include/__config +++ b/include/__config 
@@ -597,6 +597,11 @@    #define _LIBCPP_HAS_NO_ASAN   +// Allow for build-time disabling of unsigned integer sanitization +#ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK +#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute((no_sanitize("unsigned integer"))) +#endif  +  #endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__    #ifndef _LIBCPP_HAS_NO_NOEXCEPT @@ -826,6 +831,10 @@  #define _LIBCPP_HAS_NO_ATOMIC_HEADER  #endif   +#ifndef _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK +#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK +#endif  +  #endif // __cplusplus    #endif // _LIBCPP_CONFIG